Start a Conversation

Unsolved

L

9 Posts

2651

May 22nd, 2021 07:00

Accessing ECS using boto3

​Hi,​

​Does anyone have an example of accessing ECS S3 buckets using python boto3 library? Thanks!​

9 Posts

May 22nd, 2021 07:00

Found the examples.

https://github.com/EMCECS/ecs-samples/tree/master/boto3-python-workshop

Will be trying these out first.

9 Posts

June 11th, 2021 02:00

I noticed that even with user added in the ACL, I am unable to read/download file from bucket, if user is non-owner of bucket. I would need to apply access to user in the bucket policy as well. Is this a normal behaviour? Thanks.

Moderator

 • 

6.9K Posts

June 11th, 2021 08:00

Hello LeslieLim,

Here is a link to a kb that maybe of assistance.

https://dell.to/3zmXHga

November 20th, 2023 20:11

I have this problem also, and am curious to read the link (https://www.dell.com/support/kbdoc/en-us/000014295) https://dell.to/3zmXHga

Unfortunately i get this error: 

This article is permission based. Find another article.

Any ideas how to get access?

Moderator

 • 

6.9K Posts

20-11-2023 22:26 PM

Hello GuyLafleur_ch,

Here is what the link states.

ECS: How to configure BOTO for ECS

Summary: How to configure BOTO for ECS

Audience Level: Customer

Article Content


Instructions

How to configure BOTO for ECS

Boto is an AWS (Amazon Web Services) SDK for Pyton, giving developers a way to write object-oriented applications for S3 and EC2 services while allowing for low-level direct service access as necessary.

To configure the latest version - boto3 - for use with ECS, be sure to use the absolute address of the host system, including the scheme and S3 services port, e.g.

01.ecs_endpoint=https://dell.to/49Nv0eA 02.ecs_access_key_id = 'ecs_user' 03.ecs_secret_key = 'secret'

and provide them to the S3 session and resource constructors.

01.session = Session(aws_access_key_id=ecs_access_key_id, aws_secret_access_key=ecs_secret_key) 02.s3 = session.resource('s3', endpoint_url=ecs_endpoint, verify=False, 03. config=Config(signature_version='s3', s3={'addressing_style': 'path'}))

Be sure to import Session and Config to avoid any conflicts at runtime:

01.from boto3.session import Session, Config

Regarding additional options:

Specifying s3 as the signature_version implies usage of AWS v2 authentication, which provides better compatibility with ECS than the default authentication version used by boto3.

Indicating path-style addressing eliminates the need for any particular configuration in place on the ECS or DNS.

The verify=False option is only necessary when using HTTPS, and may be omitted when using ECS Test Drive (https://dell.to/49Hdg4B) as the target endpoint.

If using HTTPS, it is recommended that you use the -W command to clean the output (e.g. python -W once boto3_ecs.py ) .

No Events found!

Top